package com.balance.anole.utils;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class FormatHelper {

	public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy MM dd", Locale.CHINESE);

	public static String formatDate(Date date){
		String dateStr = null;
		dateStr = DATE_FORMAT.format(date);
		return dateStr;
	}

	public static String formatDate(Date date, String formatStr){
		String dateStr = null;
		SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
		dateStr = sdf.format(date);
		return dateStr;
	}

	public static String formatDate(Date date, String formatStr, Locale locale){
		String dateStr = null;
		SimpleDateFormat sdf = new SimpleDateFormat(formatStr, locale);
		dateStr = sdf.format(date);
		return dateStr;
	}

	public static String formatBigDecimal(BigDecimal data){
		String result = "";
		if(data != null){
			result = data.toPlainString();
		}
		return result;
	}


}
